<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>登陆页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="登陆">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyui/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyui/themes/icon.css">
<link rel="stylesheet" href="<%=path%>/easyui/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyui/css/b_login.css">

<script type="text/javascript" src="<%=path%>/easyui/js/jquery.min.js"></script>

<script src="<%=path%>/easyui/bootstrap/js/bootstrap.min.js"></script>

</head>
<body>
	<div class="login">
		<div class="loginmain">
			<h2>登录工具系统</h2>
			
			<form action="<%=path%>/main/login.do" class="form-horizontal" method="post">
				<div class="form-group"></div>
				
				<!-- 让表单在一行中显示form-horizontal -->
				<div class="form-group">
					<label for="username" class="col-lg-1 control-label">用户名</label>
					<div class="col-lg-4">
						<input type="text" name="username" id="username" class="form-control" value="admin">
					</div>
				</div>
				<div class="form-group"></div>
				<div class="form-group"></div>

				<div class="form-group">
					<label for="password" class="col-lg-1 control-label">密&nbsp;&nbsp;&nbsp;&nbsp;码</label>
					<div class="col-lg-4">
						<input type="password" name="password" id="password" class="form-control" value="admin">
					</div>
				</div>
				<div class="form-group"></div>

				<div class="form-group">
					<div class="col-lg-4 col-lg-offset-1">
						<input type="button" name="button" value="登录" class="btn btn-danger btn-lg"> <span class="text"></span>
					</div>
				</div>
			</form>
		</div>
		<div class="rightpic">
			<div>
				<!-- <img src="<%=path%>/easyui/picture/3.jpg" alt="" width="500px" height="330px"> -->
			</div>
		</div>
	</div>

	<script type="text/javascript">
		$(function(){
			$('input[name="button"]').click(function(){
				
				var $name = $('input[name="username"]');
				var $password = $('input[name="password"]');
				var $text = $(".text");
				var _name = $.trim($name.val());//去掉字符串多余空格
				var _password = $.trim($password.val());

				if(_name == ''){
					$text.text('请输入用户名');
					$name.focus();
					return;
				}
				if(_password == ''){
					$text.text('请输入密码');
					$name.focus();
					return;
				}
				
				$("form").submit();
				
			});
		});
		
	</script>


</body>
</html>